li = ["alex", "WuSir", "ritian", "barry", "武沛齐"]
# # 计算长度
# print(len(li))
# # 列表中追加元素"seven",并输出添加后的列表
# li.append("seven")
# print(li)
# # 请在列表的第1个索引位置插入元素"Tony",并输出添加后的列表
# li.insert(1,"Tony")
# print(li)
# # 请修改列表的第2个索引位置的元素为"Kelly",并输出修改后的列表
# li.insert(2, "Kelly")
# print(li)
# # 请将列表的第3个位置的值改成 "妖怪"，并输出修改后的列表
# li[3] = "妖怪"
# print(li)
# # 列表 `data=[1,"a",3,4,"heart"]` 的每一个元素追加到列表 `li` 中
# data=[1,"a",3,4,"heart"]
# li.extend(data)
# print(li)
# # 请将字符串 `s = "qwert"`的每一个元素到列表 `li` 中。
# s = "qwert"
# li.extend(list(s))
# print(li)
# # 请删除列表中的元素"barry",并输出添加后的列表
# if "barry" in li:
#     li.remove("barry")
# print("删除barry={}".format(li))
# print(li.pop(1))
# del li[2:4]
# print(li)

li = [1, 3, 2, "a", 4, "b", 5,"c"]
# print(li[0:3])
# print(li[3:6])
# print(li[::2])
# print(li[1:6:2])
# print(li[1::2])
# print(li[-1:])
# print(li[-3::-2])
# print(li[5:0:-2])

# lis = [2, 3, "k", ["qwe", 20, ["k1", ["tt", 3, "1"]], 89], "ab", "adv"]
# lis[2] = lis[2].upper()
# print(lis)
# lis[3][2][1][1] = "100"
# print(lis)
# lis[3][2][1][0] = 101
# print(lis)
# lis[3].insert(0,"火车头")
# print(lis)

# users = ["武沛齐","景女神","肖大侠"]
# for item in range(len(users)):
#     print("{} {}".format(item,users[item]))

# users = ["武沛齐","景女神","肖大侠"]
# for item in range(len(users)):
#     print("{} {}".format(item+1,users[item]))

# goods = ['汽车', '飞机', '火箭']
# print("用户可供选择的商品")
# for item in range(len(goods)):
#     print("{}{}".format(item,goods[item]))
# chice = input("输入索引:")
# print("您选择的商品是{}".format(goods[int(chice)]))

# num_list = []
# for i in range(0,51):
#     if i % 3 == 0:
#         num_list.append(i)
# print(num_list)

# num_list = []
# for i in range(0,51):
#     if i % 3 == 0:
#         num_list.insert(0,i)
# print(num_list)

# li = ["alexC", "AbC ", "egon", " riTiAn", "WuSir", "  aqc"]
# new_li = []
# for item in li:
#     i = item.strip()
#     if i.startswith("a"):
#         new_li.append(i)
# print(new_li)

# data = ["京1231", "冀8899", "京166631", "晋989"]
# new_list = []
# for item in data:
#     if item.startswith("京"):
#         new_list.append(item)
# print(len(new_list))



